home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-13 | 885 b | 50 lines | [TEXT/EDIT] |
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TEST_POINTER2
-
- creation make
-
- feature
-
- make is
- local
- ap: ARRAY[POINTER];
- aa: ARRAY[ANY];
- p: POINTER;
- pr: POINTER_REF;
- do
- !!ap.make(1,2);
- is_true(ap.item(1) = p);
- is_true(ap.count = 2);
-
- is_true(equal(ap,<<p,p>>));
-
- aa := ap;
- is_true(aa /= Void);
- ap ?= aa;
- is_true(ap /= Void);
-
- pr := p;
- is_true(pr /= Void);
- is_true(pr.item = p);
- pr := ap.item(1);
- is_true(pr.item.is_void);
- end;
-
- is_true(b: BOOLEAN) is
- do
- cpt := cpt + 1;
- if not b then
- std_output.put_string("TEST_POINTER2: ERROR Test # ");
- std_output.put_integer(cpt);
- std_output.put_string("%N");
- else
- -- std_output.put_string("Yes%N");
- end;
- end;
-
- cpt: INTEGER;
-
- end -- TEST_POINTER2
-